Skip to content

Movie enhancement setting: leave out nn::movie's NDVE network - #1953

Closed
AdyaGMD wants to merge 3 commits into
seedds:mainfrom
AdyaGMD:oot-movie-enhance
Closed

AdyaGMD wants to merge 3 commits into
seedds:mainfrom
AdyaGMD:oot-movie-enhance

Conversation

@AdyaGMD

@AdyaGMD AdyaGMD commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

What and why

Ocarina of Time's title and opening movies (Movie/Ndve/…, nn::movie's NDVE file) run compute shaders between the decoder and the screen:

  1. One converts the decoded picture (luma 1920x1080, chroma 960x540) to RGB.
  2. Eleven dispatches of a network then enhance that picture at the same size, the last one adding its result to the input.

On an M1 that network took 60–70 ms of GPU a frame (Metal System Trace), so the movies played at about 13 of their 24 fps.

This change:

  • Adds a setting, Movie enhancement (DM_MOVIE_ENHANCE, default on). The launcher shows it for games whose shader map has NDVE-tagged shaders (DM_GAME_MOVIE_NET_KEYS).
  • When it is off, the network's dispatches are left out and the last one is replaced by a same-size draw of its input into its output. The colour conversion still runs.
  • If that draw is refused, the network runs, and the frame is logged in red.

Checked

  • Ocarina of Time 0400486024DEC000 v131072, Mac app, M1, macOS 26, with Movie enhancement off in the launcher.
    • Log: movie enhancement (DM_MOVIE_ENHANCE): off, the movie network's 20 shaders are left out, eight a step, left out lines, its last step, replaced by a draw of its input.
    • The movie played.
    • No red lines.
  • Tests: test_game_profile.py gains MovieNetKeys. Not run locally; CI runs the tool tests.
  • Not checked: the GPU time with it off was not traced again, and no other game with an NDVE movie.

Docs

  • docs/settings.md (new section), docs/env_switches.tsv, dm/games/settings.tsv
  • No game files, keys or data extracted from a game in the change or the attachments

This touches dm/games/game.py and test_game_profile.py next to the MetalFX chain PR. Whichever lands second needs a small rebase.

🤖 Generated with Claude Code

…nhancement, shown for games with an nn::movie NDVE network) leaves out the network a movie frame runs between the decoder and the screen and draws its input into its output; Ocarina of Time's title and opening movies spent 60-70 ms a frame in it on an M1 and played at about 13 of their 24 fps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts) docs Documentation labels Nov 9, 2026
oliverames pushed a commit to oliverames/nxnative that referenced this pull request Nov 9, 2026
…k out (PR seedds#1953), ahead of the host's engine

Applied from seedds/nxnative PR seedds#1953 (head e9987cc), which predates the host's NDVE engine (c66a36a): the switch is asked first, and with the enhancement off the
engine is not asked at all. Not yet run on a device.

Co-authored-by: AdyaGMD <114347520+AdyaGMD@users.noreply.github.com>
@oliverames

Copy link
Copy Markdown
Contributor

I ran this on an iPhone Duo (iPhone19,4, iOS 27.3 beta), merged onto main 04811a6, through Ocarina of Time's opening movie from a new game. The phone was at thermal state 2 for most of each run.

With the network on, the frame time was about 30 ms (GPU p50 28.6 ms, about 31 fps). With DM_MOVIE_ENHANCE=0 it was 18 to 20 ms (GPU p50 16.5 to 18.4 ms, about 53 fps). So the network costs about 11 ms of GPU a frame on this phone when it's hot, and turning it off is the difference between a movie that drags and one that nearly holds 60.

One merge note: on main the host's NDVE engine dispatch now sits in front of the movie network check in nvn_mtl.m, so I had to make the engine skip when the enhancement is off as well. I can send that hunk if it helps.

AdyaGMD and others added 2 commits November 14, 2026 01:28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngine's resampler runs alone

Since the NDVE engine (nn::ndve's network as the host's kernels) came to main, it took the network's
dispatches before movie_net_dispatch could leave them out, so with DM_MOVIE_ENHANCE=0 the whole network
still ran. The engine now steps aside when the enhancement is off, and only its resampler takes the
game's 4f41ccf2 (ndve_resample_alone), on the picture as decoded: the game's translated resampler took
24 ms of the frame. Ocarina of Time's opening movie on an M1 (8-core GPU), DM_FPS_TARGET=60: 27 ms of
GPU a movie frame -> 7 ms, 60 fps held, the movie at its speed (16 s of stream time in 16 s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seedds

seedds commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thanks @AdyaGMD for tracing Ocarina of Time's NDVE movie slowdown on M1, and thanks @oliverames for the iPhone Duo check.

We are closing this PR because main has since fixed the root cause by running the NDVE movie network as native host kernels (cutting network time from 36.3 ms to 10.8 ms on M1 Pro and 12.8 ms to 6.8 ms on M4 Pro without dropping image quality), which also conflicts with this branch's workaround of skipping the network.

@seedds seedds closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants